<script setup>
import { ref } from 'vue'
import { getHotCar } from '@/api/car.js'
const listOfProcesses = ref([
  { id: 1, name: '班次查询',img:'https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png',msg:'关注出发时间和出发车站'},
  { id: 2, name: '填写订单',img:'https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png',msg:'确认乘车人和班次信息'},
  { id: 3, name: '在线支付',img:'https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png',msg:'支持支付宝、微信等多种方式'},
  { id: 4, name: '出票成功',img:'https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png',msg:'关注出票结果'},
  { id: 5, name: '取票乘车',img:'https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png',msg:'凭取票信息提前取票'},
])

const hotline = ref([

])

const hotCar = async ()=>{
  const res = await getHotCar()
    console.log(res.data.data)
    hotline.value=res.data.data
}
hotCar()
</script>


<template>
  <div class="main">
    <div class="steps">
      <ul>
        <li v-for="item in listOfProcesses" :key="item.id">
          <div class="step-content">
            <p class="icon">
              <em class="color">{{ item.id }}</em>
              <i :class="'step-0'+item.id"></i>
              <span>{{ item.name }}</span>
            </p>
            <p class="txt">{{ item.msg }}</p>
          </div>
          <i v-if="item.id < 5"></i>
        </li>
      </ul>
    </div>

    <div class="wrap-left">
      <div class="tools">
        <h2 class="title">
          <span>汽车票工具箱</span>
        </h2>
        <ul>
          <li class="order">
            <a href="javascript:;">
              <em>我的订单</em>
            </a>
          </li>
          <li class="kefu">
            <a href="javascript:;">
              <em>在线客服</em>
            </a>
          </li>
          <li class="faq">
            <a href="javascript:;">
              <em>常见问题</em>
            </a>
          </li>
        </ul>
      </div>
      <div class="questions">
        <h2 class="title">
          <span>常见问题</span>
          <a href="javascript:;">查看更多</a>
        </h2>
        <div class="ques-info">
          <ul>
            <li>
              <h4>预订车票后要如何取票呢？</h4>
              <p>购票成功后，会生成取票信息并发送短信给您，请您凭该取票短信和身份证原件到发车站自助取票机或服务专窗取票。</p>
            </li>
            <li>
              <h4>可以由亲朋好友代取票吗？</h4>
              <p>可以由他人代取票，代取人需凭取票信息和乘车人身份证前往自助取票机或人工取票窗口取票。</p>
            </li>
            <li>
              <h4>没带身份证/凭身份证号能取票吗？</h4>
              <p>由于各地客运站规定不同，为确保您取票顺利，建议您携带身份证。</p>
            </li>
          </ul>
        </div>
      </div>
    </div>

    <div class="wrap-right">
      <div class="hot-lines">
        <h2 class="title">
          <span>热门线路</span>
        </h2>
        <ul>
          <li title="烟台-招远" data-depcity="烟台" data-descity="招远" v-for="item in hotline" :key="item.id">
            <div class="line-detail">
              <div class="line-city">
                {{item.beginningName}}<span><i></i></span>{{item.destinationName}}
              </div>
              <div class="line-info">
                <span class="btn">GO &gt;</span>
              </div>
            </div>
          </li>
          <li class="list-more">
            <div class="line-detail">
              <div class="more-txt">期待更多线路</div>
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.main{
  overflow: hidden;
}
.steps{
  width: 1190px;
  height: 120px;
  margin: 30px auto;
  background: #f5f5f5;
  ul{
    li{
      width: 238px;
      height: 120px;
      position: relative;
      text-align: center;
      float: left;
      overflow: hidden;
      .step-content{
        width: 238px;
        height: 100px;
        position: absolute;
        top: 0;
        left: 0;
        border-radius: 40px;
        padding-top: 20px;
        .txt{
          clear: both;
          color: #999;
          margin-top: 8px;
          font: normal normal normal 12px / 20px Arial, sans-serif;
        }
        .icon{
          padding-left: 20px;
          overflow: hidden;
          i{
            display: inline-block;
            width: 52px;
            height: 56px;
            float: left;
            margin-right: 20px;
          }
          .step-01{
            background: url(https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png) no-repeat -53px -144px;
          }
          .step-02{
            background: url(https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png) no-repeat -210px -146px;
          }
          .step-03{
            background: url(https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png) no-repeat -53px -264px;
          }
          .step-04{
            background: url(https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png) no-repeat -53px -144px;
          }
          .step-05{
            background: url(https://file.40017.cn/img140017cnproduct/touch/bus/pc/tools.png) no-repeat -206px -262px;
          }
        }
        em{
          display: inline-block;
          width: 30px;
          height: 30px;
          border-radius: 30px;
          line-height: 30px;
          text-align: center;
          background: #fff;
          font-size: 20px;
          box-shadow: 3px 3px 3px #ddd;
          float: left;
          margin: 10px 25px 0 0;
          font-style: normal;
        }
        .color{
          color:#00c777;
        }
        span{
          float: left;
          display: inline-block;
          width: 44px;
          font-size: 20px;
          color: #333;
          line-height: 28px;
        }
      }
      >i{
        display: inline-block;
        height: 172px;
        width: 172px;
        border-radius: 174px;
        border-right: 3px solid #fff;
        position: absolute;
        top: -28px;
        right: 0;
      }
    }
  }
}
.wrap-left{
  width: 465px;
  float: left;
  .title{
    font-size: 20px;
    height: 42px;
    line-height: 42px;
    background: #f5f5f5;
    color: #333;
    span{
      margin-left: 20px;
    }
    a{
      font-size: 14px;
      color: #00a0ff;
      float: right;
      margin-right: 20px;
    }
  }
  .tools{
    overflow: hidden;
    ul{
      margin-top: 3px;
      li{
        width: 153px;
        height: 116px;
        float: left;
        margin-left: 3px;
        position: relative;
        text-align: center;
        background: #f5f5f5 url(//file.40017.cn/groundtraffic/buspc/home/images/tools.png?v=2017121505) no-repeat;
        a{
          display: inline-block;
          width: 153px;
          height: 116px;
          font-size: 16px;
          color: #333;
          em{
            position: absolute;
            bottom: 15px;
            left: 44px;
          }
        }
      }
      .order{
        overflow: hidden;
        margin-left: 0;
      }
    }
  }
  .questions{
    overflow: hidden;
    margin-top: 30px;
    border: 1px solid #e7e7e7;
    .ques-info{
      ul{
        padding: 20px;
        li{
          margin-top: 22px;
          h4{
            font-size: 14px;
            color: #666;
            font-weight: 700;
          }
          p{
            font-size: 12px;
            color: #999;
            line-height: 24px;
          }
        }
        li:first-child{
          margin-top: 0;
        }
      }
    }
  }
}
.wrap-right{
  width: 690px;
  float: right;
  border: 1px solid #e7e7e7;
  .title {
    font-size: 20px;
    height: 42px;
    line-height: 42px;
    background: #f5f5f5;
    color: #333;
    span{
      margin-left: 20px;
    }
  }
  .hot-lines{
    ul{
      padding: 20px 20px 0;
      margin-left: -20px;
      li{
        float: left;
        width: 190px;
        height: 92px;
        margin: 0 0 20px 30px;
        position: relative;
        overflow: hidden;
        .line-detail{
          padding: 10px 20px;
          border: 1px solid #e7e7e7;
          border-radius: 5px;
          overflow: hidden;
          .more-txt{
            font-size: 18px;
            text-align: center;
            height: 70px;
            line-height: 70px;
          }
        }
      }
      li:before {
        display: block;
        content: "";
        width: 16px;
        height: 16px;
        border-radius: 100%;
        border: 1px solid #e7e7e7;
        background: #fff;
        position: absolute;
        top: 50%;
        margin-top: -8px;
        left: -8px;
      }
      li:after{
        right: -8px;
        display: block;
        content: "";
        width: 16px;
        height: 16px;
        border-radius: 100%;
        border: 1px solid #e7e7e7;
        background: #fff;
        position: absolute;
        top: 50%;
        margin-top: -8px;
      }
    }
    .line-city{
      height: 24px;
      line-height: 24px;
      font-size: 18px;
      span{
        display: inline-block;
        border-bottom: 2px solid #999;
        position: relative;
        width: 38px;
        height: 18px;
        overflow: hidden;
        margin: 0 10px;
        top: -5px;
        i{
          border: 4px solid transparent;
          border-left: 8px solid #999;
          position: absolute;
          right: -4px;
          bottom: -4px;
        }
      }
    }
    .line-info{
      margin-top: 8px;
      position: relative;
      height: 30px;
      .btn{
        width: 50px;
        height: 20px;
        background: #ffeae8;
        color: #ff6257;
        float: right;
        margin-top: 5px;
        text-align: center;
        border-radius: 10px;
        position: relative;
        right: 0;
      }
    }
  }
}
</style>